package mysql

import "gorm.io/gorm"

type Book struct {
	gorm.Model
	UserId       int64  `gorm:"type:int(11);not null;"`
	ClassId      int64  `gorm:"type:int(11);not null;"`
	Title        string `gorm:"type:varchar(20);not null;"`
	Image        string `gorm:"type:varchar(500);not null;"`
	Context      string `gorm:"type:text;not null;"`
	BrowseNumber int64  `gorm:"type:int(11);not null;comment:'浏览量'"`
}

type Class struct {
	gorm.Model
	Name string `gorm:"type:varchar(20);not null;"`
}

type BookData struct {
	Book
	UserName  string
	ClassName string
}
